<template>
  <el-select
      v-model="per"
      placeholder=""
  >
    <el-option
        v-for="item in perList"
        :label="item"
        :value="item"
    />
  </el-select>
</template>
<script setup lang="ts">
import {inject, ref, watch} from "vue";

const perList=ref([])
const props=defineProps(['id'])
const perAllList=inject('perAllList')
const per=defineModel()

watch(()=>props.id,()=>{
  perList.value=[]
  for (let i = 0; i < perAllList.value.length; i++) {
    if (props.id==perAllList.value[i].gid){
      perList.value.push(perAllList.value[i].per)
    }
  }
  per.value=perList.value[0]
})
</script>